import React from "react"
import { createBrowserRouter ,Navigate } from "react-router-dom";
import App from "../App.jsx"
import Login from "../components/Zjm/Login.jsx"

import User from "../components/Hs/User.jsx";
import Message from "../components/Jzl/Message.jsx";
import Campus from "../components/Wxy/Campus.jsx";
import SchoolRun from '../components/Wxy/SchoolRun.jsx'
import End from "../components/Wxy/End.jsx";
import Settings from "../components/Hs/Settings.jsx";
import Aboutus from "../components/Hs/Aboutus.jsx";
import Accountsecurity from "../components/Hs/Accountsecurity.jsx";
import Authenticationmain from "../components/Hs/Authenticationmain.jsx";
import Feedback from "../components/Hs/Feedback.jsx";
import Helpcenter from "../components/Hs/Helpcenter.jsx";
import Messagesettings from "../components/Hs/Messagesettings.jsx";
import Mycollection from "../components/Hs/Mycollection.jsx";
import Myfans from "../components/Hs/Myfans.jsx";
import Myollowings from "../components/Hs/Myollowings.jsx";
import Personalhomepage from "../components/Hs/Personalhomepage.jsx";
import Personalinformation from "../components/Hs/Personalinformation.jsx";
import Privacymanagement from "../components/Hs/Privacymanagement.jsx";
import Privacysettings from "../components/Hs/Privacysettings.jsx";
import Ranking from "../components/Hs/Ranking.jsx";
import Runningrecord from "../components/Hs/Runningrecord.jsx";
import Runningsettings from "../components/Hs/Runningsettings.jsx";
import Serviceagreement from "../components/Hs/Serviceagreement.jsx";
import Fu from "../components/Wzm/Fu.jsx";
import Search from "../components/Wzm/Search.jsx";
import Dong from "../components/Wzm/Dong.jsx";
import Dan from "../components/Wzm/Dan.jsx";
import Jie from "../components/Wzm/Jie.jsx";
import Cover from "../components/Zjm/Cover.jsx";
import Authentication from "../components/Zjm/Authentication.jsx";
import Iphone from "../components/Zjm/Iphone.jsx";
import Face from "../components/Zjm/Face.jsx";
import Wechat from "../components/Zjm/Wechat.jsx";
import Qidan from "../components/Wzm/QIdan.jsx";
import Tiany from "../components/Wzm/Tiany.jsx";
import Erb from "../components/Wzm/Erb.jsx";
import Fa from "../components/Wzm/Fa.jsx";



import Take from "../components/Jzl/TakeModel.jsx";
import One from '../components/Jzl/One.jsx'
import Two from '../components/Jzl/Two.jsx'
import Three from '../components/Jzl/Three.jsx'
import Four from '../components/Jzl/Four.jsx'
// const Islogin = (a)=>{
//     let Go = a.children.type
//     if(localStorage.getItem("token")){
//         return <Go></Go>
//     }else{
//         return <Navigate to="/login"></Navigate>
//     }
// }

let router = createBrowserRouter([
    {path:"/app",element:<App></App>,children:[
        {path:"/app/home",element:<Fu></Fu>},
        {path:"/app/dong",element:<Dong></Dong>},
        {path:"/app/dan/:id",element:<Dan></Dan>},
        {path:"/app/jie/:id",element:<Jie></Jie>},
        {path:"/app/user",element:<User></User>},
        {path:"/app/message",element:<Message></Message>},
        {path:"/app/qidan/:id",element:<Qidan></Qidan>},
        {path:"/app/campus",element:<Campus></Campus>},
    ]},
    {path:'/take',element:<Take></Take>},
    {path:'/one',element:<One></One>},
    {path:'/two',element:<Two></Two>},
    {path:'/three',element:<Three></Three>},
    {path:'/four',element:<Four></Four>},
    {path:'/',element:<Navigate to="/app/home"></Navigate>},
    {path:"/login",element:<Login></Login>},
    {path:"/cover",element:<Cover/>},
    {path:"/fa",element:<Fa></Fa>},
    {path:"/erb",element:<Erb></Erb>},
    {path:"/tiany",element:<Tiany></Tiany>},
    {path:"/renzheng",element:<Authentication/>},
    {path:"/iphone",element:<Iphone/>},
    {path:"/face",element:<Face/>},
    {path:"/wechat",element:<Wechat/>},
    {path:"/search",element:<Search></Search>},
    {path:'/end',element:<End></End>},
    {path:"/settings",element:<Settings></Settings>},
    {path:"/schoolrun",element:<SchoolRun></SchoolRun>},
    {path:"/",element:<Navigate to="/app"></Navigate>},
    {path:"/aboutus",element:<Aboutus></Aboutus>},
    {path:"/accountsecurity",element:<Accountsecurity></Accountsecurity>},
    {path:"/authenticationmain",element:<Authenticationmain></Authenticationmain>},
    {path:"/feedback",element:<Feedback></Feedback>},
    {path:"/helpcenter",element:<Helpcenter></Helpcenter>},
    {path:"/messagesettings",element:<Messagesettings></Messagesettings>},
    {path:"/mycollection",element:<Mycollection></Mycollection>},
    {path:"/myfans",element:<Myfans></Myfans>},
    {path:"/myollowings",element:<Myollowings></Myollowings>},
    {path:"/personalhomepage",element:<Personalhomepage></Personalhomepage>},
    {path:"/personalinformation",element:<Personalinformation></Personalinformation>},
    {path:"/privacymanagement",element:<Privacymanagement></Privacymanagement>},
    {path:"/privacysettings",element:<Privacysettings></Privacysettings>},
    {path:"/ranking",element:<Ranking></Ranking>},
    {path:"/runningrecord",element:<Runningrecord></Runningrecord>},
    {path:"/runningsettings",element:<Runningsettings></Runningsettings>},
    {path:"/Serviceagreement",element:<Serviceagreement></Serviceagreement>},
])

export default router